VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "Mscomctl.ocx"
Begin VB.Form frmMiGrid 
   BorderStyle     =   5  'Sizable ToolWindow
   Caption         =   "Modificar Reporte Isss"
   ClientHeight    =   9165
   ClientLeft      =   60
   ClientTop       =   330
   ClientWidth     =   13905
   LinkTopic       =   "Form2"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   9165
   ScaleWidth      =   13905
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton cmdImprimir 
      BackColor       =   &H00E0E0E0&
      Caption         =   "Imprimir"
      Height          =   615
      Left            =   12000
      Picture         =   "frmMiGrid.frx":0000
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   8400
      Width           =   855
   End
   Begin VB.CommandButton CmdSalir 
      BackColor       =   &H00E0E0E0&
      Caption         =   "&Salir"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   12960
      Picture         =   "frmMiGrid.frx":030A
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   8400
      Width           =   735
   End
   Begin MSComctlLib.ListView ReporteIsss 
      Height          =   7935
      Left            =   240
      TabIndex        =   0
      Top             =   120
      Width           =   13335
      _ExtentX        =   23521
      _ExtentY        =   13996
      View            =   3
      LabelWrap       =   -1  'True
      HideSelection   =   0   'False
      AllowReorder    =   -1  'True
      Checkboxes      =   -1  'True
      FullRowSelect   =   -1  'True
      GridLines       =   -1  'True
      _Version        =   393217
      ForeColor       =   -2147483640
      BackColor       =   16777215
      BorderStyle     =   1
      Appearance      =   1
      NumItems        =   12
      BeginProperty ColumnHeader(1) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         Text            =   "Cod"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(2) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   1
         Text            =   "Devenga"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(3) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   2
         Text            =   "Isss"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(4) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   3
         Text            =   "DiasTrabaja"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(5) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   4
         Text            =   "Quincena"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(6) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   5
         Text            =   "CodEmpleao"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(7) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   6
         Text            =   "Devenga"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(8) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   7
         Text            =   "Isss"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(9) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   8
         Text            =   "DiasTraba"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(10) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   9
         Text            =   "Quincena"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(11) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   10
         Text            =   "Nombres"
         Object.Width           =   1764
      EndProperty
      BeginProperty ColumnHeader(12) {BDD1F052-858B-11D1-B16A-00C0F0283628} 
         SubItemIndex    =   11
         Text            =   "TipoPlania"
         Object.Width           =   1764
      EndProperty
   End
End
Attribute VB_Name = "frmMiGrid"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

Private Sub ChequesPendientesImprimir_DblClick()
   '' MODIFICAR EL NUMERO DE CHEQUE
      frmModificarValorTomado.Show 1
      ChequesPendientesImprimir.SelectedItem = Str(ValorTomadoModificado)
      If DE.rsActualizarNumeroCheque.State = adStateOpen Then DE.rsActualizarNumeroCheque.Close
      DE.ActualizarNumeroCheque Str(ValorTomadoModificado), ChequesPendientesImprimir.SelectedItem.ListSubItems(4)
End Sub

Private Sub cmdImprimir_Click()
       
    If DE.rsActualizarImpreso.State = adStateOpen Then DE.rsActualizarImpreso.Close
    
    If ChequesPendientesImprimir.ListItems.Count > 0 Then
        For i = 1 To ChequesPendientesImprimir.ListItems.Count
            If ChequesPendientesImprimir.ListItems(i).Checked Then
                ' le cambio el estatus de N al campo impreso
                  DE.ActualizarImpreso ChequesPendientesImprimir.ListItems(i).ListSubItems(4)
            End If
        Next i
        If DE.rsTrasladoCheques.State = adStateOpen Then DE.rsTrasladoCheques.Close
        DE.TrasladoCheques
    End If
    '' ahora los imprimo
                
        '' Imprimo los cheques
        RutaReportes = DE.rsGENCParametros.Fields("RUTA_REPORTES")
        Imprimir RutaReportes & "ImprimirCheques.rpt", "", "", "", ""
        
        
        '' Pregunto si se imprimieron todos, por si se rompio alguno
        Confirmar = MsgBox("La Impresion fue Exitosa?", vbYesNo + vbQuestion + vbDefaultButton2)
        If Confirmar = vbYes Then
            'Pasa los registros al Historico
             
             DE.Cnn.Execute "Update ImprimirCheques set Impreso = 'S' "
             If DE.rsTrasladoCheques.State = adStateOpen Then DE.rsTrasladoCheques.Close
             DE.TrasladoCheques
             
             
            Else
            ' se presenta una pantalla donde se podra imprimir de nuevo
            Unload Me
            frmConfirmar.Show 1
    End If
    
End Sub


Private Sub CmdSalir_Click()
        Unload Me
End Sub

Private Sub Form_Load()
    Left = Screen.Width / 2 - Width / 2
    Top = (Screen.Height / 2 - Height / 2) - 800
    LimpiarObjetos Me
    Me.Picture = LoadResPicture(104, 0)
    MostrarRegistros
End Sub

Private Sub ListadoProCompuestosEncabezado_Click()
     CodigoProductoCompuesto = ListadoProCompuestosEncabezado.SelectedItem.Text
    
    If DE.rsInvPKProductos_CompuestosDetalle.State = adStateOpen Then DE.rsInvPKProductos_CompuestosDetalle.Close
    DE.InvPKProductos_CompuestosDetalle CodigoProductoCompuesto
    
    
    
    
    If DE.rsInvPKProductos_CompuestosDetalle.EOF Then
        GrdDetalle.ClearFields
        Exit Sub
    End If
    
    With GrdDetalle
        Set .DataSource = DE
            .DataMember = "InvPKProductos_CompuestosDetalle"
            .Columns(0).Width = 0
            .Columns(1).Width = 0
            .Columns(2).Width = 3500
            .Columns(3).Width = 1000
            .Columns(4).Width = 1000
    End With

End Sub
Private Sub MostrarRegistros()
    On Error Resume Next
    Dim dTotal As Double
    Dim itm As ListItem
    Dim I_contador As Integer
  
    I_contador = 0
    dTotal = 0
    
    
    Me.ReporteIsss.ListItems.Clear
    
    If DE.rsCSeguroSocial.State = adStateOpen Then DE.rsCSeguroSocial.Close
    DE.CSeguroSocial
    
    While Not DE.rsCSeguroSocial.EOF
       Set itm = Me.ReporteIsss.ListItems.Add(, , DE.rsCSeguroSocial.Fields("Correlativo").Value)
            itm.SubItems(1) = DE.rsCSeguroSocial.Fields("CodigoEmpleado").Value
            itm.SubItems(2) = DE.rsCSeguroSocial.Fields("DEVENGAdo").Value
            itm.SubItems(3) = DE.rsCSeguroSocial.Fields("SeguroSocial").Value
            itm.SubItems(4) = DE.rsCSeguroSocial.Fields("diastrabajados").Value
            itm.SubItems(5) = DE.rsCSeguroSocial.Fields("quincena").Value
            itm.SubItems(6) = DE.rsCSeguroSocial.Fields("CodigoEmpleado2").Value
            itm.SubItems(7) = DE.rsCSeguroSocial.Fields("devengado2").Value
            itm.SubItems(8) = DE.rsCSeguroSocial.Fields("SeguroSocial2").Value
            itm.SubItems(9) = DE.rsCSeguroSocial.Fields("diastrabajados2").Value
            itm.SubItems(10) = DE.rsCSeguroSocial.Fields("quincena2").Value
            itm.SubItems(11) = DE.rsCSeguroSocial.Fields("Nombres").Value
            itm.SubItems(12) = DE.rsCSeguroSocial.Fields("nombreTipoPlanilla").Value
            DE.rsCSeguroSocial.MoveNext
    Wend
End Sub

